<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
		*{margin:0;padding:0;}
		.act{color:#f00;}
	</style>
	<body>
		<div id="app">
			<div :class="active">{{message}}</div>
			<p>--------------------------------------</p>
			<!-- 不会覆盖  原来的class -->
			<div class="title" :class="{'act': isActive, 'line': isLine}">{{message}}</div>
			<button v-on:click="btnClick" type="button">变色</button>
		</div>
		<script src="../js/vue.js"></script>
		<script>
			let vm = new Vue({
				el: "#app",
				data: {
					message: "你好啊",
					active: "act",
					isActive: true,
					isLine: true
				},
				methods: {
					btnClick: function(){
						this.isActive = !this.isActive;
					}
				}
			});
		</script>
	</body>
</html>
